﻿@using MC.RideEvent.Mvc.Models.ViewModel
@model CarModel

@{
    var member = Session["CurrentMember"] as MemberViewModel; 
}

<script type="text/javascript">
    $(document).ready(function () {
        console.log("chargmt");
        $("#VehiculeId").kendoDropDownList({
            autoBind: false,
            //optionLabel: "Sélectionnez un modèle...",
            dataTextField: "VehiculeToString",
            dataValueField: "Id",
            dataSource: {
                transport: {
                    read: {
                        dataType: "json",
                        url: "@Url.Action("VehiculesMember", "VehiculeApi")",
                        data: function () {
                            return { memberId: '@member.Id' };
                        }
                    }
                }
            }
        }).data('kendoDropDownList');
        
        var dataSource = new kendo.data.DataSource({
            data: [
              { name: "Jane Doe", age: 30 },
              { name: "John Doe", age: 33 }
            ]
        });

        $("#NumberPlaces").kendoDropDownList({
            autoBind: false,
            //optionLabel: "Sélectionnez un modèle...",
            dataTextField: "name",
            dataValueField: "age",
            dataSource: dataSource
        }).data('kendoDropDownList');
    });
</script>
